package com.design.pattern.clinic.structural.pipeline;

public interface Pipe<IN,OUT> {
    class StepException extends RuntimeException{
        public StepException(Throwable t) {
            super(t);
        }
    }

    default <NEW_OUT>Pipe<IN,NEW_OUT> add(Pipe<OUT,NEW_OUT> pipe){
        return input->pipe.process(process(input));
    }


    OUT process(IN input) throws StepException;

}
